package info.yihua.codelab.motan.demo.server;

import info.yihua.codelab.motan.demo.exception.MotanDemoException;
import info.yihua.codelab.motan.demo.service.IMotanDemoService;

/**
 * Created by Jonathan on 16/7/13.
 */
public class MotanDemoServiceImpl implements IMotanDemoService {

    @Override
    public String hello(String name) throws MotanDemoException {

        System.out.println("rpc invoked.");

        if(name.equals("exception")) {
            throw new MotanDemoException(1001,"Exception Simulation");
        }

        return "Hello, " + name;
    }
}
